[asterisk-dev] [Code Review] 3541: res_http_websocket: Create a websocket client

wdoekes reviewboard at asterisk.org
Sat May 31 04:06:17 CDT 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/3541/#review12020
-----------------------------------------------------------



trunk/main/uri.c
<https://reviewboard.asterisk.org/r/3541/#comment21966>

    I'm not seeing that with the git version. And what happens when someone *does* want X in the URL?
    
    
    My test against the git version:
    
    src/uriparser-git$ cat 1.c 
    
    #include <uriparser/Uri.h>
    #include <stdio.h>
    
    int main(int argc, char **argv) {
    	UriParserStateA state;
    	UriUriA uri;
    
    	state.uri = &uri;
    	if (uriParseUriA(&state, argv[1]) != URI_SUCCESS) {
    		/* Failure */
    		uriFreeUriMembersA(&uri);
    		return 1;
    	}
    
    #define P(s, c, k) do { \
    	if (c && k.first) { printf(s " = \"%.*s\"\n", \
    		(int)(k.afterLast - k.first), k.first); \
    	} else { printf(s " = null\n"); } } while(0)
    
    	P("scheme", 1, uri.scheme);
    	P("host", 1, uri.hostText);
    	P("path", uri.pathHead, uri.pathHead->text);
    
    	uriFreeUriMembersA(&uri);
    	return 0;
    }
    
    
    
    src/uriparser-git$ gcc 1.c src/*.c -I`pwd`/include -w
    
    src/uriparser-git$ ./a.out "http://test"
    scheme = "http"
    host = "test"
    path = null
    src/uriparser-git$ ./a.out "http://test/"
    scheme = "http"
    host = "test"
    path = ""
    src/uriparser-git$ ./a.out "http://test/X"
    scheme = "http"
    host = "test"
    path = "X"
    uriparser-git$ ./a.out "http://test?1"
    scheme = "http"
    host = "test"
    path = null
    uriparser-git$ ./a.out "http://test/?1"
    scheme = "http"
    host = "test"
    path = ""
    
    
    Is something wrong with your path_size calculations above?
    
    The "X" is indeed used as a placeholder for certain (missing?) items:
    
    src/UriCommon.c:/*extern*/ const URI_CHAR * const URI_FUNC(SafeToPointTo) = _UT("X");
    
    


- wdoekes


On May 30, 2014, 5:36 p.m., Kevin Harwell wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/3541/
> -----------------------------------------------------------
> 
> (Updated May 30, 2014, 5:36 p.m.)
> 
> 
> Review request for Asterisk Developers and Joshua Colp.
> 
> 
> Bugs: ASTERISK-23742
>     https://issues.asterisk.org/jira/browse/ASTERISK-23742
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> Add client websocket capabilities to Asterisk.
> 
> 
> Diffs
> -----
> 
>   trunk/tests/test_websocket_client.c PRE-CREATION 
>   trunk/tests/test_uri.c PRE-CREATION 
>   trunk/res/res_http_websocket.exports.in 414813 
>   trunk/res/res_http_websocket.c 414813 
>   trunk/main/uri.c PRE-CREATION 
>   trunk/main/http.c 414813 
>   trunk/include/asterisk/uri.h PRE-CREATION 
>   trunk/include/asterisk/http_websocket.h 414813 
>   trunk/include/asterisk/http.h 414813 
> 
> Diff: https://reviewboard.asterisk.org/r/3541/diff/
> 
> 
> Testing
> -------
> 
> Created some unit tests.
> 
> 
> Thanks,
> 
> Kevin Harwell
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20140531/f2bf8bcd/attachment.html>


More information about the asterisk-dev mailing list