Commit ab3232e2 authored by jehan's avatar jehan

make sure an uri path segment can be detected even if null

I.E just a /
parent e3fc5dce
......@@ -20,7 +20,7 @@
<folderInfo id="cdt.managedbuild.toolchain.gnu.macosx.base.557244179.779699347" name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.macosx.base.688348245" name="cdt.managedbuild.toolchain.gnu.macosx.base" superClass="cdt.managedbuild.toolchain.gnu.macosx.base">
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.MachO64" id="cdt.managedbuild.target.gnu.platform.macosx.base.1183422670" name="Debug Platform" osList="macosx" superClass="cdt.managedbuild.target.gnu.platform.macosx.base"/>
<builder arguments="-j4 CFLAGS=&quot;-g -Wall -Werror&quot; V=1" command="make" id="cdt.managedbuild.target.gnu.builder.macosx.base.1706103106" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.macosx.base"/>
<builder arguments="-j4 CFLAGS=&quot;-g -Wall &quot; V=1" command="make" id="cdt.managedbuild.target.gnu.builder.macosx.base.1706103106" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.macosx.base"/>
<tool id="cdt.managedbuild.tool.macosx.c.linker.macosx.base.2093869426" name="MacOS X C Linker" superClass="cdt.managedbuild.tool.macosx.c.linker.macosx.base">
<inputType id="cdt.managedbuild.tool.macosx.c.linker.input.451088761" superClass="cdt.managedbuild.tool.macosx.c.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
......
......@@ -59,7 +59,7 @@ else
CFLAGS="$CFLAGS -g"
fi
STRICT_OPTIONS=" -Wall -Werror -Wno-unknown-pragmas -Wno-error=unknown-pragmas -Wno-error=pragmas"
STRICT_OPTIONS=" -Wall -Werror -Wno-unknown-pragmas -Wno-error=unknown-pragmas -Wno-error=pragmas -Wno-error=unknown-warning-option"
dnl because of antlr3 we must accept a few warnings...
dnl more portable for the moment
LESS_STRICT_OPTIONS=
......
......@@ -4,7 +4,7 @@ SUBDIRS=grammars
noinst_LTLIBRARIES=libbellesip_tls.la
#to disable warning introduced by compatibility between polar 1.2 and 1.3
libbellesip_tls_la_SOURCES= transports/tls_listeningpoint_polarssl.c transports/tls_channel_polarssl.c
libbellesip_tls_la_SOURCES= transports/tls_listeningpoint_polarssl.c transports/tls_channel_polarssl.c http-listener.c
libbellesip_tls_la_CFLAGS=$(LESS_STRICT_OPTIONS) $(TLS_CFLAGS) $(LIBBELLESIP_CFLAGS)
......@@ -48,8 +48,8 @@ libbellesip_la_SOURCES= \
belle_sip_dict.c \
generic-uri.c \
http-provider.c \
http-message.c \
http-listener.c
http-message.c
if BUILD_TUNNEL
libbellesip_la_SOURCES+= transports/tunnel_listeningpoint.c \
......
......@@ -437,11 +437,11 @@ antlr3NewAsciiStringCopyStream((pANTLR3_UINT8)value,(ANTLR3_UINT32)length,NULL)
if (name) belle_sip_header_set_name(BELLE_SIP_HEADER(l_object),name);\
return l_object;\
}
typedef struct belle_sip_param_pair {
struct belle_sip_param_pair {
int ref;
char* name;
char* value;
} belle_sip_param_pair_t;
} ;
void belle_sip_param_pair_destroy(belle_sip_param_pair_t* pair) ;
......@@ -453,7 +453,7 @@ belle_sip_param_pair_t* belle_sip_param_pair_ref(belle_sip_param_pair_t* obj);
void belle_sip_param_pair_unref(belle_sip_param_pair_t* obj);
void belle_sip_header_address_set_quoted_displayname(belle_sip_header_address_t* address,const char* value);
/*calss header*/
struct _belle_sip_header {
......@@ -463,7 +463,7 @@ struct _belle_sip_header {
char *unparsed_value;
};
void belle_sip_header_set_next(belle_sip_header_t* header,belle_sip_header_t* next);
void belle_sip_response_fill_for_dialog(belle_sip_response_t *obj, belle_sip_request_t *req);
void belle_sip_util_copy_headers(belle_sip_message_t *orig, belle_sip_message_t *dest, const char*header, int multiple);
......
noinst_LTLIBRARIES=libbellesip_generated.la
libbellesip_generated_la_CFLAGS=$(ANTLR_CFLAGS) -Wno-error=pragmas
libbellesip_generated_la_CFLAGS=$(LIBBELLESIP_CFLAGS) $(ANTLR_CFLAGS) $(STRICT_OPTIONS)
nodist_libbellesip_generated_la_SOURCES= \
......@@ -12,7 +12,7 @@ nodist_libbellesip_generated_la_SOURCES= \
.NOTPARALLEL $(builddir)/belle_sip_messageParser.c $(builddir)/belle_sip_messageParser.h \
$(builddir)/belle_sip_messageLexer.c $(builddir)/belle_sip_messageLexer.h : belle_sip_message.g
$(ANTLR) -make -fo $(builddir) $(srcdir)/belle_sip_message.g
$(ANTLR) -make -Xmultithreaded -fo $(builddir) $(srcdir)/belle_sip_message.g
.NOTPARALLEL $(builddir)/belle_sdpLexer.c \
$(builddir)/belle_sdpParser.c \
......
......@@ -84,8 +84,8 @@ options {
@includes {
#include "belle-sip/defs.h"
#include "belle-sip/types.h"
#include "parserutils.h"
#include "belle-sip/belle-sdp.h"
#include "parserutils.h"
}
session_description returns [belle_sdp_session_description_t* ret]
......@@ -256,7 +256,7 @@ scope { int is_number; }
@init { $fmt::is_number=0;}: ((DIGIT+)=>(DIGIT+){$fmt::is_number=1;} | token+ )
{belle_sdp_media_set_media_formats($media::current
,belle_sip_list_append(belle_sdp_media_get_media_formats($media::current)
,(void*)($fmt::is_number?(long)atoi((const char*)$fmt.text->chars):$fmt.text->chars)));};
,(void*)($fmt::is_number?(void*)(long)atoi((const char*)$fmt.text->chars):$fmt.text->chars)));};
//;typically an RTP payload type for audio
//;and video media
proto options { greedy = false; }: ~(SPACE|CR|LF)*;
......
......@@ -73,10 +73,10 @@ options {
#include "belle-sip/defs.h"
#include "belle-sip/types.h"
#include "parserutils.h"
#include "belle-sip/message.h"
#include "belle-sip/http-message.h"
#include "parserutils.h"
BELLESIP_INTERNAL_EXPORT void belle_sip_header_address_set_quoted_displayname(belle_sip_header_address_t* address,const char* value);
}
@rulecatch
......@@ -262,7 +262,7 @@ catch [ANTLR3_MISMATCHED_TOKEN_EXCEPTION]
http_version: {IS_TOKEN(HTTP/)}? generic_version;
http_response returns [belle_http_response_t* ret]
http_response returns [belle_http_response_t* ret=NULL]
: common_response {$ret=BELLE_HTTP_RESPONSE($common_response.ret);} ;
http_status_line returns [belle_http_response_t* ret]
......@@ -315,14 +315,14 @@ hier_part[belle_generic_uri_t* uri] returns [belle_generic_uri_t* ret=NULL]
}) ?;
path_segments[belle_generic_uri_t* uri]
: (segment ( SLASH segment )*)
: (segment? ( SLASH segment )*)
{
char* unescaped_path;
unescaped_path=belle_sip_to_unescaped_string((const char *)$path_segments.text->chars);
belle_generic_uri_set_path(uri,(const char*)unescaped_path);
belle_sip_free(unescaped_path);
};
segment: pchar* ( SEMI param )*;
segment: pchar+ ( SEMI param )*;
param: pchar*;
pchar: unreserved | escaped | COLON | AT | AND | EQUAL | PLUS | DOLLARD | COMMA;
......
......@@ -54,7 +54,7 @@ static void process_auth_requested(belle_http_request_listener_t *l, belle_sip_a
BELLE_SIP_DECLARE_VPTR(belle_http_callbacks_t);
/*BELLE_SIP_DECLARE_VPTR(belle_http_callbacks_t);*/
BELLE_SIP_IMPLEMENT_INTERFACE_BEGIN(belle_http_callbacks_t,belle_http_request_listener_t)
process_response_event,
......
......@@ -32,7 +32,9 @@
BELLESIP_INTERNAL_EXPORT belle_sip_header_t* belle_sip_header_get_next(const belle_sip_header_t* headers);
BELLESIP_INTERNAL_EXPORT char* belle_sip_to_unescaped_string(const char* buff);
BELLESIP_INTERNAL_EXPORT void belle_sip_header_set_next(belle_sip_header_t* header,belle_sip_header_t* next);
BELLESIP_INTERNAL_EXPORT char* belle_sip_to_unescaped_string(const char* buff);
belle_sip_param_pair_t* belle_sip_param_pair_new(const char* name,const char* value);
char* _belle_sip_str_dup_and_unquote_string(const char* quoted_string);
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment