#define FLAG_DEAD 0x08
#define FLAG_SSL_W_WANTS_R 0x10 /* output needs to wait until input possible */
#define FLAG_SSL_R_WANTS_W 0x20 /* input needs to wait until output possible */
+#define FLAG_ZIPSSL 0x40
#define IsSSL(x) ((x)->flags & FLAG_SSL)
#define IsZip(x) ((x)->flags & FLAG_ZIP)
#define IsDead(x) ((x)->flags & FLAG_DEAD)
#define IsSSLWWantsR(x) ((x)->flags & FLAG_SSL_W_WANTS_R)
#define IsSSLRWantsW(x) ((x)->flags & FLAG_SSL_R_WANTS_W)
+#define IsZipSSL(x) ((x)->flags & FLAG_ZIPSSL)
#define SetSSL(x) ((x)->flags |= FLAG_SSL)
#define SetZip(x) ((x)->flags |= FLAG_ZIP)
#define SetDead(x) ((x)->flags |= FLAG_DEAD)
#define SetSSLWWantsR(x) ((x)->flags |= FLAG_SSL_W_WANTS_R)
#define SetSSLRWantsW(x) ((x)->flags |= FLAG_SSL_R_WANTS_W)
+#define SetZipSSL(x) ((x)->flags |= FLAG_ZIPSSL)
#define ClearSSL(x) ((x)->flags &= ~FLAG_SSL)
#define ClearZip(x) ((x)->flags &= ~FLAG_ZIP)
#define ClearDead(x) ((x)->flags &= ~FLAG_DEAD)
#define ClearSSLWWantsR(x) ((x)->flags &= ~FLAG_SSL_W_WANTS_R)
#define ClearSSLRWantsW(x) ((x)->flags &= ~FLAG_SSL_R_WANTS_W)
+#define ClearZipSSL(x) ((x)->flags &= ~FLAG_ZIPSSL)
#define NO_WAIT 0x0
#define WAIT_PLAIN 0x1
{
rb_close(conn->plain_fd);
- if(conn->id >= 0)
+ if(conn->id >= 0 && !IsZipSSL(conn))
rb_dlinkDelete(&conn->node, connid_hash(conn->id));
rb_dlinkAdd(conn, &conn->node, &dead_list);
return;
mod_cmd_write_queue(ctl, outstat, strlen(outstat) + 1); /* +1 is so we send the \0 as well */
}
+static void
+change_connid(mod_ctl_t *ctl, mod_ctl_buf_t *ctlb)
+{
+ int32_t id = buf_to_int32(&ctlb->buf[1]);
+ int32_t newid = buf_to_int32(&ctlb->buf[5]);
+ conn_t *conn = conn_find_by_id(id);
+ if(conn->id >= 0)
+ rb_dlinkDelete(&conn->node, connid_hash(conn->id));
+ SetZipSSL(conn);
+ conn->id = newid;
+}
+
#ifdef HAVE_LIBZ
static void
zlib_process(mod_ctl_t * ctl, mod_ctl_buf_t * ctlb)
process_stats(ctl, ctl_buf);
break;
}
+ case 'Y':
+ {
+ change_connid(ctl, ctl_buf);
+ break;
+ }
+
#ifdef HAVE_LIBZ
case 'Z':
{
break;
}
#else
- case 'Y':
+
case 'Z':
send_nozlib_support(ctl, ctl_buf);
break;