-Thu Jul 11 17:38:06 CDT 2013
+Fri Jul 26 11:26:00 CDT 2013
self->tp_stime = self->tp_ktime = self->tp_rtime = su_now();
if (pri->pri_vtable->vtp_init_secondary &&
- pri->pri_vtable->vtp_init_secondary(self, socket, accepted,
- return_reason) < 0) {
- if (pri->pri_vtable->vtp_deinit_secondary)
- pri->pri_vtable->vtp_deinit_secondary(self);
- su_home_zap(self->tp_home);
- return NULL;
+
+ pri->pri_vtable->vtp_init_secondary(self, socket, accepted, return_reason) < 0) {
+
+ if (pri->pri_vtable->vtp_deinit_secondary) {
+ pri->pri_vtable->vtp_deinit_secondary(self);
+ }
+ su_timer_destroy(self->tp_timer);
+ su_home_zap(self->tp_home);
+
+ return NULL;
}
/* Set IP TOS if it is set in primary */
if ( wspri->ws_secure ) wstp->ws_secure = 1;
memset(&wstp->ws, 0, sizeof(wstp->ws));
-
+
if (ws_init(&wstp->ws, socket, wstp->ws_secure ? wspri->ssl_ctx : NULL, 0) < 0) {
+ ws_destroy(&wstp->ws);
+ su_close(socket);
+ wstp->ws_initialized = -1;
return *return_reason = "WS_INIT", -1;
}
wstp->ws_initialized = 1;
self->tp_pre_framed = 1;
+
return 0;
}
}
+ if (bytes > sizeof(wsh->buffer)) {
+ goto err;
+ }
+
*(wsh->buffer+bytes) = '\0';
if (strncasecmp(wsh->buffer, "GET ", 4)) {
#else
if (x++) Sleep(10);
#endif
- } while (r == -1 && (errno == EAGAIN || errno == EINTR) && x < 100);
+ } while (r == -1 && (errno == EAGAIN || errno == EINTR || errno == EWOULDBLOCK ||
+ errno == 35 || errno == 730035 || errno == 2 || errno == 60) && x < 100);
if (x >= 100) {
r = -1;
}
while (!wsh->down && !wsh->handshake) {
- ws_handshake(wsh);
+ int r = ws_handshake(wsh);
+
+ if (r < 0) {
+ wsh->down = 1;
+ return -1;
+ }
}
if (wsh->down) {