Update doc
This commit is contained in:
parent
a3fa3bd62a
commit
48867bdcf4
|
@ -173,7 +173,7 @@ underlying network socket::
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(events & BEV_EVENT_EOF) {
|
if(events & BEV_EVENT_EOF) {
|
||||||
fprintf(stderr, "%s disconnected\n", session_data->client_addr);
|
fprintf(stderr, "%s EOF\n", session_data->client_addr);
|
||||||
} else if(events & BEV_EVENT_ERROR) {
|
} else if(events & BEV_EVENT_ERROR) {
|
||||||
fprintf(stderr, "%s network error\n", session_data->client_addr);
|
fprintf(stderr, "%s network error\n", session_data->client_addr);
|
||||||
} else if(events & BEV_EVENT_TIMEOUT) {
|
} else if(events & BEV_EVENT_TIMEOUT) {
|
||||||
|
|
BIN
objects.inv
BIN
objects.inv
Binary file not shown.
File diff suppressed because one or more lines are too long
|
@ -700,6 +700,8 @@ here.</p>
|
||||||
<span class="k">static</span> <span class="n">http2_stream_data</span><span class="o">*</span> <span class="nf">create_http2_stream_data</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">uri</span><span class="p">,</span>
|
<span class="k">static</span> <span class="n">http2_stream_data</span><span class="o">*</span> <span class="nf">create_http2_stream_data</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">uri</span><span class="p">,</span>
|
||||||
<span class="k">struct</span> <span class="n">http_parser_url</span> <span class="o">*</span><span class="n">u</span><span class="p">)</span>
|
<span class="k">struct</span> <span class="n">http_parser_url</span> <span class="o">*</span><span class="n">u</span><span class="p">)</span>
|
||||||
<span class="p">{</span>
|
<span class="p">{</span>
|
||||||
|
<span class="cm">/* MAX 5 digits (max 65535) + 1 ':' + 1 NULL (because of snprintf) */</span>
|
||||||
|
<span class="kt">size_t</span> <span class="n">extra</span> <span class="o">=</span> <span class="mi">7</span><span class="p">;</span>
|
||||||
<span class="n">http2_stream_data</span> <span class="o">*</span><span class="n">stream_data</span> <span class="o">=</span> <span class="n">malloc</span><span class="p">(</span><span class="k">sizeof</span><span class="p">(</span><span class="n">http2_stream_data</span><span class="p">));</span>
|
<span class="n">http2_stream_data</span> <span class="o">*</span><span class="n">stream_data</span> <span class="o">=</span> <span class="n">malloc</span><span class="p">(</span><span class="k">sizeof</span><span class="p">(</span><span class="n">http2_stream_data</span><span class="p">));</span>
|
||||||
|
|
||||||
<span class="n">stream_data</span><span class="o">-></span><span class="n">uri</span> <span class="o">=</span> <span class="n">uri</span><span class="p">;</span>
|
<span class="n">stream_data</span><span class="o">-></span><span class="n">uri</span> <span class="o">=</span> <span class="n">uri</span><span class="p">;</span>
|
||||||
|
@ -707,16 +709,14 @@ here.</p>
|
||||||
<span class="n">stream_data</span><span class="o">-></span><span class="n">stream_id</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span><span class="p">;</span>
|
<span class="n">stream_data</span><span class="o">-></span><span class="n">stream_id</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span><span class="p">;</span>
|
||||||
|
|
||||||
<span class="n">stream_data</span><span class="o">-></span><span class="n">authoritylen</span> <span class="o">=</span> <span class="n">u</span><span class="o">-></span><span class="n">field_data</span><span class="p">[</span><span class="n">UF_HOST</span><span class="p">].</span><span class="n">len</span><span class="p">;</span>
|
<span class="n">stream_data</span><span class="o">-></span><span class="n">authoritylen</span> <span class="o">=</span> <span class="n">u</span><span class="o">-></span><span class="n">field_data</span><span class="p">[</span><span class="n">UF_HOST</span><span class="p">].</span><span class="n">len</span><span class="p">;</span>
|
||||||
|
<span class="n">stream_data</span><span class="o">-></span><span class="n">authority</span> <span class="o">=</span> <span class="n">malloc</span><span class="p">(</span><span class="n">stream_data</span><span class="o">-></span><span class="n">authoritylen</span> <span class="o">+</span> <span class="n">extra</span><span class="p">);</span>
|
||||||
|
<span class="n">memcpy</span><span class="p">(</span><span class="n">stream_data</span><span class="o">-></span><span class="n">authority</span><span class="p">,</span>
|
||||||
|
<span class="o">&</span><span class="n">uri</span><span class="p">[</span><span class="n">u</span><span class="o">-></span><span class="n">field_data</span><span class="p">[</span><span class="n">UF_HOST</span><span class="p">].</span><span class="n">off</span><span class="p">],</span> <span class="n">u</span><span class="o">-></span><span class="n">field_data</span><span class="p">[</span><span class="n">UF_HOST</span><span class="p">].</span><span class="n">len</span><span class="p">);</span>
|
||||||
<span class="k">if</span><span class="p">(</span><span class="n">u</span><span class="o">-></span><span class="n">field_set</span> <span class="o">&</span> <span class="p">(</span><span class="mi">1</span> <span class="o"><<</span> <span class="n">UF_PORT</span><span class="p">))</span> <span class="p">{</span>
|
<span class="k">if</span><span class="p">(</span><span class="n">u</span><span class="o">-></span><span class="n">field_set</span> <span class="o">&</span> <span class="p">(</span><span class="mi">1</span> <span class="o"><<</span> <span class="n">UF_PORT</span><span class="p">))</span> <span class="p">{</span>
|
||||||
<span class="cm">/* MAX 5 digits (max 65535) + 1 ':' + 1 NULL (because of snprintf) */</span>
|
|
||||||
<span class="kt">size_t</span> <span class="n">extra</span> <span class="o">=</span> <span class="mi">7</span><span class="p">;</span>
|
|
||||||
<span class="n">stream_data</span><span class="o">-></span><span class="n">authority</span> <span class="o">=</span> <span class="n">malloc</span><span class="p">(</span><span class="n">stream_data</span><span class="o">-></span><span class="n">authoritylen</span> <span class="o">+</span> <span class="n">extra</span><span class="p">);</span>
|
|
||||||
<span class="n">stream_data</span><span class="o">-></span><span class="n">authoritylen</span> <span class="o">+=</span>
|
<span class="n">stream_data</span><span class="o">-></span><span class="n">authoritylen</span> <span class="o">+=</span>
|
||||||
<span class="n">snprintf</span><span class="p">(</span><span class="n">stream_data</span><span class="o">-></span><span class="n">authority</span> <span class="o">+</span> <span class="n">u</span><span class="o">-></span><span class="n">field_data</span><span class="p">[</span><span class="n">UF_HOST</span><span class="p">].</span><span class="n">len</span><span class="p">,</span> <span class="n">extra</span><span class="p">,</span>
|
<span class="n">snprintf</span><span class="p">(</span><span class="n">stream_data</span><span class="o">-></span><span class="n">authority</span> <span class="o">+</span> <span class="n">u</span><span class="o">-></span><span class="n">field_data</span><span class="p">[</span><span class="n">UF_HOST</span><span class="p">].</span><span class="n">len</span><span class="p">,</span> <span class="n">extra</span><span class="p">,</span>
|
||||||
<span class="s">":%u"</span><span class="p">,</span> <span class="n">u</span><span class="o">-></span><span class="n">port</span><span class="p">);</span>
|
<span class="s">":%u"</span><span class="p">,</span> <span class="n">u</span><span class="o">-></span><span class="n">port</span><span class="p">);</span>
|
||||||
<span class="p">}</span>
|
<span class="p">}</span>
|
||||||
<span class="n">memcpy</span><span class="p">(</span><span class="n">stream_data</span><span class="o">-></span><span class="n">authority</span><span class="p">,</span>
|
|
||||||
<span class="o">&</span><span class="n">uri</span><span class="p">[</span><span class="n">u</span><span class="o">-></span><span class="n">field_data</span><span class="p">[</span><span class="n">UF_HOST</span><span class="p">].</span><span class="n">off</span><span class="p">],</span> <span class="n">u</span><span class="o">-></span><span class="n">field_data</span><span class="p">[</span><span class="n">UF_HOST</span><span class="p">].</span><span class="n">len</span><span class="p">);</span>
|
|
||||||
|
|
||||||
<span class="n">stream_data</span><span class="o">-></span><span class="n">pathlen</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
|
<span class="n">stream_data</span><span class="o">-></span><span class="n">pathlen</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
|
||||||
<span class="k">if</span><span class="p">(</span><span class="n">u</span><span class="o">-></span><span class="n">field_set</span> <span class="o">&</span> <span class="p">(</span><span class="mi">1</span> <span class="o"><<</span> <span class="n">UF_PATH</span><span class="p">))</span> <span class="p">{</span>
|
<span class="k">if</span><span class="p">(</span><span class="n">u</span><span class="o">-></span><span class="n">field_set</span> <span class="o">&</span> <span class="p">(</span><span class="mi">1</span> <span class="o"><<</span> <span class="n">UF_PATH</span><span class="p">))</span> <span class="p">{</span>
|
||||||
|
|
|
@ -301,7 +301,7 @@ underlying network socket:</p>
|
||||||
<span class="k">return</span><span class="p">;</span>
|
<span class="k">return</span><span class="p">;</span>
|
||||||
<span class="p">}</span>
|
<span class="p">}</span>
|
||||||
<span class="k">if</span><span class="p">(</span><span class="n">events</span> <span class="o">&</span> <span class="n">BEV_EVENT_EOF</span><span class="p">)</span> <span class="p">{</span>
|
<span class="k">if</span><span class="p">(</span><span class="n">events</span> <span class="o">&</span> <span class="n">BEV_EVENT_EOF</span><span class="p">)</span> <span class="p">{</span>
|
||||||
<span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"%s disconnected</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">session_data</span><span class="o">-></span><span class="n">client_addr</span><span class="p">);</span>
|
<span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"%s EOF</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">session_data</span><span class="o">-></span><span class="n">client_addr</span><span class="p">);</span>
|
||||||
<span class="p">}</span> <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="n">events</span> <span class="o">&</span> <span class="n">BEV_EVENT_ERROR</span><span class="p">)</span> <span class="p">{</span>
|
<span class="p">}</span> <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="n">events</span> <span class="o">&</span> <span class="n">BEV_EVENT_ERROR</span><span class="p">)</span> <span class="p">{</span>
|
||||||
<span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"%s network error</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">session_data</span><span class="o">-></span><span class="n">client_addr</span><span class="p">);</span>
|
<span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"%s network error</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">session_data</span><span class="o">-></span><span class="n">client_addr</span><span class="p">);</span>
|
||||||
<span class="p">}</span> <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="n">events</span> <span class="o">&</span> <span class="n">BEV_EVENT_TIMEOUT</span><span class="p">)</span> <span class="p">{</span>
|
<span class="p">}</span> <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="n">events</span> <span class="o">&</span> <span class="n">BEV_EVENT_TIMEOUT</span><span class="p">)</span> <span class="p">{</span>
|
||||||
|
@ -936,7 +936,7 @@ stream is about to close and we no longer use that object.</p>
|
||||||
<span class="p">{</span>
|
<span class="p">{</span>
|
||||||
<span class="n">http2_stream_data</span> <span class="o">*</span><span class="n">stream_data</span><span class="p">;</span>
|
<span class="n">http2_stream_data</span> <span class="o">*</span><span class="n">stream_data</span><span class="p">;</span>
|
||||||
<span class="n">SSL</span> <span class="o">*</span><span class="n">ssl</span> <span class="o">=</span> <span class="n">bufferevent_openssl_get_ssl</span><span class="p">(</span><span class="n">session_data</span><span class="o">-></span><span class="n">bev</span><span class="p">);</span>
|
<span class="n">SSL</span> <span class="o">*</span><span class="n">ssl</span> <span class="o">=</span> <span class="n">bufferevent_openssl_get_ssl</span><span class="p">(</span><span class="n">session_data</span><span class="o">-></span><span class="n">bev</span><span class="p">);</span>
|
||||||
|
<span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"%s disconnected</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">session_data</span><span class="o">-></span><span class="n">client_addr</span><span class="p">);</span>
|
||||||
<span class="k">if</span><span class="p">(</span><span class="n">ssl</span><span class="p">)</span> <span class="p">{</span>
|
<span class="k">if</span><span class="p">(</span><span class="n">ssl</span><span class="p">)</span> <span class="p">{</span>
|
||||||
<span class="n">SSL_shutdown</span><span class="p">(</span><span class="n">ssl</span><span class="p">);</span>
|
<span class="n">SSL_shutdown</span><span class="p">(</span><span class="n">ssl</span><span class="p">);</span>
|
||||||
<span class="p">}</span>
|
<span class="p">}</span>
|
||||||
|
@ -1319,7 +1319,7 @@ stream is about to close and we no longer use that object.</p>
|
||||||
<span class="k">return</span><span class="p">;</span>
|
<span class="k">return</span><span class="p">;</span>
|
||||||
<span class="p">}</span>
|
<span class="p">}</span>
|
||||||
<span class="k">if</span><span class="p">(</span><span class="n">events</span> <span class="o">&</span> <span class="n">BEV_EVENT_EOF</span><span class="p">)</span> <span class="p">{</span>
|
<span class="k">if</span><span class="p">(</span><span class="n">events</span> <span class="o">&</span> <span class="n">BEV_EVENT_EOF</span><span class="p">)</span> <span class="p">{</span>
|
||||||
<span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"%s disconnected</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">session_data</span><span class="o">-></span><span class="n">client_addr</span><span class="p">);</span>
|
<span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"%s EOF</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">session_data</span><span class="o">-></span><span class="n">client_addr</span><span class="p">);</span>
|
||||||
<span class="p">}</span> <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="n">events</span> <span class="o">&</span> <span class="n">BEV_EVENT_ERROR</span><span class="p">)</span> <span class="p">{</span>
|
<span class="p">}</span> <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="n">events</span> <span class="o">&</span> <span class="n">BEV_EVENT_ERROR</span><span class="p">)</span> <span class="p">{</span>
|
||||||
<span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"%s network error</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">session_data</span><span class="o">-></span><span class="n">client_addr</span><span class="p">);</span>
|
<span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"%s network error</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">session_data</span><span class="o">-></span><span class="n">client_addr</span><span class="p">);</span>
|
||||||
<span class="p">}</span> <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="n">events</span> <span class="o">&</span> <span class="n">BEV_EVENT_TIMEOUT</span><span class="p">)</span> <span class="p">{</span>
|
<span class="p">}</span> <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="n">events</span> <span class="o">&</span> <span class="n">BEV_EVENT_TIMEOUT</span><span class="p">)</span> <span class="p">{</span>
|
||||||
|
|
Loading…
Reference in New Issue