From d2b189e573f882d17dfc6c70619911093c03b3d4 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 6 Apr 2012 21:29:37 +0900 Subject: [PATCH 1/4] Updated doc --- lib/includes/spdylay/spdylay.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/includes/spdylay/spdylay.h b/lib/includes/spdylay/spdylay.h index e03f55e9..08322a4d 100644 --- a/lib/includes/spdylay/spdylay.h +++ b/lib/includes/spdylay/spdylay.h @@ -1126,7 +1126,13 @@ typedef struct { * The :member:`spdylay_session_callbacks.send_callback` must be * specified. If the application code uses `spdylay_session_recv()`, * the :member:`spdylay_session_callbacks.recv_callback` must be - * specified. The other members of |callbacks| can be ``NULL``. + * specified. The other members of |callbacks| can be ``NULL``. To + * use CREDENTIAL frame, specify :macro:`SPDYLAY_PROTO_SPDY3` in + * |version| and specify + * :member:`spdylay_session_callbacks.get_credential_ncerts`, + * :member:`spdylay_session_callbacks.get_credential_cert` and + * :member:`spdylay_session_callbacks.get_credential_proof`. See also + * `spdylay_session_set_initial_client_cert_origin()`. * * This function returns 0 if it succeeds, or one of the following * negative error codes: From c89fc13c80ca54e902b16318ff2bd8204f03fa4b Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 6 Apr 2012 23:35:30 +0900 Subject: [PATCH 2/4] Fixed segmentation fault in out of memory situation --- lib/spdylay_map.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/spdylay_map.c b/lib/spdylay_map.c index 8fb8dc47..eef9165e 100644 --- a/lib/spdylay_map.c +++ b/lib/spdylay_map.c @@ -105,6 +105,7 @@ static spdylay_map_entry* insert_recur(spdylay_map_entry *entry, entry = spdylay_map_entry_new(key, val); if(entry == NULL) { *error = SPDYLAY_ERR_NOMEM; + return NULL; } } else if(key == entry->key) { *error = SPDYLAY_ERR_INVALID_ARGUMENT; From 36ba636e301b0cfd6431b2f47f6c33c62a896bee Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 6 Apr 2012 23:36:10 +0900 Subject: [PATCH 3/4] Fixed memory leak in out of memory situation --- lib/spdylay_session.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/spdylay_session.c b/lib/spdylay_session.c index 52199beb..40c879de 100644 --- a/lib/spdylay_session.c +++ b/lib/spdylay_session.c @@ -811,7 +811,7 @@ static int spdylay_session_get_credential_cert(spdylay_session *session, return 0; fail: for(j = 0; j < i; ++j) { - free(certs[i].data); + free(certs[j].data); } free(certs); return SPDYLAY_ERR_NOMEM; @@ -865,6 +865,7 @@ int spdylay_session_prep_credential(spdylay_session *session, rv = spdylay_session_add_frame(session, SPDYLAY_CTRL, frame, NULL); if(rv != 0) { spdylay_frame_credential_free(&frame->credential); + free(frame); return rv; } return SPDYLAY_ERR_CREDENTIAL_PENDING; From 6c32c50e23f86eaa3efc705cf56cc8198eaeb190 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 6 Apr 2012 23:37:25 +0900 Subject: [PATCH 4/4] Include spdylay_net.h instead of arpa/inet.h --- tests/spdylay_session_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/spdylay_session_test.c b/tests/spdylay_session_test.c index 355dabd7..b6be370f 100644 --- a/tests/spdylay_session_test.c +++ b/tests/spdylay_session_test.c @@ -28,10 +28,10 @@ #include #include -#include #include "spdylay_session.h" #include "spdylay_stream.h" +#include "spdylay_net.h" #define OB_CTRL(ITEM) spdylay_outbound_item_get_ctrl_frame(ITEM) #define OB_CTRL_TYPE(ITEM) spdylay_outbound_item_get_ctrl_frame_type(ITEM)