@@ -279,14 +279,15 @@ struct us_socket_context_t *us_create_socket_context(int ssl, struct us_loop_t *
279279 return context ;
280280}
281281
282- struct us_socket_context_t * us_create_bun_socket_context ( int ssl , struct us_loop_t * loop , int context_ext_size , struct us_bun_socket_context_options_t options , enum create_bun_socket_error_t * err ) {
282+ struct us_socket_context_t * us_create_bun_ssl_socket_context ( struct us_loop_t * loop , int context_ext_size , struct us_bun_socket_context_options_t options , enum create_bun_socket_error_t * err ) {
283283#ifndef LIBUS_NO_SSL
284- if (ssl ) {
285- /* This function will call us, again, with SSL = false and a bigger ext_size */
286- return (struct us_socket_context_t * ) us_internal_bun_create_ssl_socket_context (loop , context_ext_size , options , err );
287- }
284+ /* This function will call us, again, with SSL = false and a bigger ext_size */
285+ return (struct us_socket_context_t * ) us_internal_bun_create_ssl_socket_context (loop , context_ext_size , options , err );
288286#endif
287+ return us_create_bun_nossl_socket_context (loop , context_ext_size );
288+ }
289289
290+ struct us_socket_context_t * us_create_bun_nossl_socket_context (struct us_loop_t * loop , int context_ext_size ) {
290291 /* This path is taken once either way - always BEFORE whatever SSL may do LATER.
291292 * context_ext_size will however be modified larger in case of SSL, to hold SSL extensions */
292293
@@ -370,8 +371,8 @@ struct us_listen_socket_t *us_socket_context_listen(int ssl, struct us_socket_co
370371 ls -> s .timeout = 255 ;
371372 ls -> s .long_timeout = 255 ;
372373 ls -> s .flags .low_prio_state = 0 ;
373- ls -> s .flags .is_paused = 0 ;
374-
374+ ls -> s .flags .is_paused = 0 ;
375+ ls -> s . flags . is_ipc = 0 ;
375376 ls -> s .next = 0 ;
376377 ls -> s .flags .allow_half_open = (options & LIBUS_SOCKET_ALLOW_HALF_OPEN );
377378 us_internal_socket_context_link_listen_socket (context , ls );
@@ -406,6 +407,7 @@ struct us_listen_socket_t *us_socket_context_listen_unix(int ssl, struct us_sock
406407 ls -> s .flags .low_prio_state = 0 ;
407408 ls -> s .flags .allow_half_open = (options & LIBUS_SOCKET_ALLOW_HALF_OPEN );
408409 ls -> s .flags .is_paused = 0 ;
410+ ls -> s .flags .is_ipc = 0 ;
409411 ls -> s .next = 0 ;
410412 us_internal_socket_context_link_listen_socket (context , ls );
411413
@@ -414,7 +416,6 @@ struct us_listen_socket_t *us_socket_context_listen_unix(int ssl, struct us_sock
414416 return ls ;
415417}
416418
417-
418419struct us_socket_t * us_socket_context_connect_resolved_dns (struct us_socket_context_t * context , struct sockaddr_storage * addr , int options , int socket_ext_size ) {
419420 LIBUS_SOCKET_DESCRIPTOR connect_socket_fd = bsd_create_connect_socket (addr , options );
420421 if (connect_socket_fd == LIBUS_SOCKET_ERROR ) {
@@ -437,6 +438,7 @@ struct us_socket_t* us_socket_context_connect_resolved_dns(struct us_socket_cont
437438 socket -> flags .low_prio_state = 0 ;
438439 socket -> flags .allow_half_open = (options & LIBUS_SOCKET_ALLOW_HALF_OPEN );
439440 socket -> flags .is_paused = 0 ;
441+ socket -> flags .is_ipc = 0 ;
440442 socket -> connect_state = NULL ;
441443
442444
@@ -563,6 +565,7 @@ int start_connections(struct us_connecting_socket_t *c, int count) {
563565 s -> flags .low_prio_state = 0 ;
564566 s -> flags .allow_half_open = (c -> options & LIBUS_SOCKET_ALLOW_HALF_OPEN );
565567 s -> flags .is_paused = 0 ;
568+ s -> flags .is_ipc = 0 ;
566569 /* Link it into context so that timeout fires properly */
567570 us_internal_socket_context_link_socket (s -> context , s );
568571
@@ -739,6 +742,7 @@ struct us_socket_t *us_socket_context_connect_unix(int ssl, struct us_socket_con
739742 connect_socket -> flags .low_prio_state = 0 ;
740743 connect_socket -> flags .allow_half_open = (options & LIBUS_SOCKET_ALLOW_HALF_OPEN );
741744 connect_socket -> flags .is_paused = 0 ;
745+ connect_socket -> flags .is_ipc = 0 ;
742746 connect_socket -> connect_state = NULL ;
743747 connect_socket -> connect_next = NULL ;
744748 us_internal_socket_context_link_socket (context , connect_socket );
@@ -843,6 +847,14 @@ void us_socket_context_on_data(int ssl, struct us_socket_context_t *context, str
843847 context -> on_data = on_data ;
844848}
845849
850+ void us_socket_context_on_fd (int ssl , struct us_socket_context_t * context , struct us_socket_t * (* on_fd )(struct us_socket_t * s , int fd )) {
851+ #ifndef LIBUS_NO_SSL
852+ if (ssl ) return ;
853+ #endif
854+
855+ context -> on_fd = on_fd ;
856+ }
857+
846858void us_socket_context_on_writable (int ssl , struct us_socket_context_t * context , struct us_socket_t * (* on_writable )(struct us_socket_t * s )) {
847859#ifndef LIBUS_NO_SSL
848860 if (ssl ) {
0 commit comments