~yozik04/nginx/rtmp

« back to all changes in this revision

Viewing changes to src/event/ngx_event_openssl.c

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2014-02-15 03:05:42 UTC
  • mfrom: (4.3.10 sid)
  • Revision ID: package-import@ubuntu.com-20140215030542-71ubtowl24vf7nfn
Tags: 1.4.5-1ubuntu1
* Resynchronise with Debian (LP: #1280511).  Remaining changes:
  - debian/patches/ubuntu-branding.patch:
    + Add Ubuntu branding to server_tokens.

Show diffs side-by-side

added added

removed removed

Lines of Context:
967
967
            size -= n;
968
968
 
969
969
            if (size == 0) {
 
970
                c->read->ready = 1;
970
971
                return bytes;
971
972
            }
972
973
 
976
977
        }
977
978
 
978
979
        if (bytes) {
 
980
            if (c->ssl->last != NGX_AGAIN) {
 
981
                c->read->ready = 1;
 
982
            }
 
983
 
979
984
            return bytes;
980
985
        }
981
986
 
2226
2231
ngx_ssl_get_session_id(ngx_connection_t *c, ngx_pool_t *pool, ngx_str_t *s)
2227
2232
{
2228
2233
    int           len;
2229
 
    u_char       *p, *buf;
 
2234
    u_char       *buf;
2230
2235
    SSL_SESSION  *sess;
2231
2236
 
2232
2237
    sess = SSL_get0_session(c->ssl->connection);
2233
 
 
2234
 
    len = i2d_SSL_SESSION(sess, NULL);
2235
 
 
2236
 
    buf = ngx_alloc(len, c->log);
2237
 
    if (buf == NULL) {
2238
 
        return NGX_ERROR;
 
2238
    if (sess == NULL) {
 
2239
        s->len = 0;
 
2240
        return NGX_OK;
2239
2241
    }
2240
2242
 
 
2243
    buf = sess->session_id;
 
2244
    len = sess->session_id_length;
 
2245
 
2241
2246
    s->len = 2 * len;
2242
2247
    s->data = ngx_pnalloc(pool, 2 * len);
2243
2248
    if (s->data == NULL) {
2244
 
        ngx_free(buf);
2245
2249
        return NGX_ERROR;
2246
2250
    }
2247
2251
 
2248
 
    p = buf;
2249
 
    i2d_SSL_SESSION(sess, &p);
2250
 
 
2251
2252
    ngx_hex_dump(s->data, buf, len);
2252
2253
 
2253
 
    ngx_free(buf);
2254
 
 
2255
2254
    return NGX_OK;
2256
2255
}
2257
2256