Bug#884247: Debian Bug #884247 - linphone with upnp 1.8 - patch.

Uwe Kleine-König uwe at kleine-koenig.org
Mon Feb 5 21:33:50 UTC 2018


Hello,

On 02/05/2018 08:08 PM, Sebastian Ramacher wrote:
>> I am using Slackware.
>>
>> Bye, Robert
> 
>>        mbedtls 2.6.1                                libraries/mbedtls                                  mbedtls-2.6.1-i586-1_SBo
>>      bctoolbox 0.6.0                                libraries/bctoolbox                                bctoolbox-0.6.0-i586-1_SBo
>>          mbedtls 2.6.1                              libraries/mbedtls                                  mbedtls-2.6.1-i586-1_SBo
>>        bctoolbox 0.6.0                              libraries/bctoolbox                                bctoolbox-0.6.0-i586-1_SBo
>>        jdk 8u162                                    development/jdk                                    jdk-7u80-i586-1
>>        libantlr3c 3.4                               libraries/libantlr3c                               libantlr3c-3.4-i486-1_SBo
>>        mbedtls 2.6.1                                libraries/mbedtls                                  mbedtls-2.6.1-i586-1_SBo
>>      belle-sip 1.6.3                                libraries/belle-sip                                belle-sip-1.6.3-i586-1_SBo
>>          mbedtls 2.6.1                              libraries/mbedtls                                  mbedtls-2.6.1-i586-1_SBo
>>        bctoolbox 0.6.0                              libraries/bctoolbox                                bctoolbox-0.6.0-i586-1_SBo
>>        mbedtls 2.6.1                                libraries/mbedtls                                  mbedtls-2.6.1-i586-1_SBo
>>      bzrtp 1.0.6                                    libraries/bzrtp                                    bzrtp-1.0.6-i586-1_SBo
>>      ffmpeg 3.2.4                                   multimedia/ffmpeg                                  ffmpeg-2.6.8-i686_custom-1_SBo
>>      libsrtp 1.6.0                                  libraries/libsrtp                                  libsrtp-1.6.0-i586-1_SBo
>>      libupnp 1.8.3                                  libraries/libupnp                                  libupnp-1.8.3-i586-1_SBo
>>      mbedtls 2.6.1                                  libraries/mbedtls                                  mbedtls-2.6.1-i586-1_SBo
>>      speex 1.2.0                                    audio/speex                                        speex-1.2.0-i486-1_SBo
>>    linphone 3.12.0                                  network/linphone                                   linphone-3.12.0-i586-1_SBo
>>    x264 20170225                                    multimedia/x264                                    x264-20131101-i486-2_SBo
>>  msx264 1.5.3                                       libraries/msx264                                   msx264-1.5.3-i586-1_SBo
> 
>> diff --git a/linphone-3.12.0/mediastreamer2/src/upnp/upnp_igd.c b/linphone-3.12.0/mediastreamer2/src/upnp/upnp_igd.c
>> index 4f7d161..cee436c 100644
>> --- a/linphone-3.12.0/mediastreamer2/src/upnp/upnp_igd.c
>> +++ b/linphone-3.12.0/mediastreamer2/src/upnp/upnp_igd.c
>> @@ -395,7 +395,7 @@ int upnp_igd_send_action(upnp_igd_context* igd_ctxt, upnp_igd_device_node *devic
>>   *   d_event  -- event associated with the new device
>>   *
>>   ********************************************************************************/
>> -void upnp_igd_add_device(upnp_igd_context *igd_ctxt, IXML_Document *desc_doc, struct Upnp_Discovery *d_event) {
>> +void upnp_igd_add_device(upnp_igd_context *igd_ctxt, IXML_Document *desc_doc, UpnpDiscovery *d_event) {
>>  	upnp_igd_device_node *deviceNode, *tmpdevnode;
>>  	int found = 0;
>>  	int ret;
>> @@ -423,7 +423,7 @@ void upnp_igd_add_device(upnp_igd_context *igd_ctxt, IXML_Document *desc_doc, st
>>  	baseURL = upnp_igd_get_first_document_item(igd_ctxt, desc_doc, "URLBase");
>>  	relURL = upnp_igd_get_first_document_item(igd_ctxt, desc_doc, "presentationURL");
>>  
>> -	ret = UpnpResolveURL((baseURL ? baseURL : d_event->Location), relURL, presURL);
>> +	ret = UpnpResolveURL((baseURL ? baseURL : UpnpString_get_String(UpnpDiscovery_get_Location(d_event))), relURL, presURL);

The third parameter to the ?: operator can be simplified to:

	UpnpDiscovery_get_Location_cstr(d_event)

>>  	if (UPNP_E_SUCCESS != ret) {
>>  		upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error generating presURL from %s + %s", baseURL, relURL);
>> @@ -444,7 +444,7 @@ void upnp_igd_add_device(upnp_igd_context *igd_ctxt, IXML_Document *desc_doc, st
>>  			if (found) {
>>  				/* The device is already there, so just update  */
>>  				/* the advertisement timeout field */
>> -				tmpdevnode->device.advr_time_out = d_event->Expires;
>> +				tmpdevnode->device.advr_time_out = UpnpDiscovery_get_Expires(d_event);
>>  				upnp_igd_print(igd_ctxt, UPNP_IGD_DEBUG, "IGD device: %s[%s] | Update expires(%d)", friendlyName, UDN, tmpdevnode->device.advr_time_out);
>>  			} else {
>>  				upnp_igd_print(igd_ctxt, UPNP_IGD_MESSAGE, "Add IGD device: %s[%s]", friendlyName, UDN);
>> @@ -453,12 +453,12 @@ void upnp_igd_add_device(upnp_igd_context *igd_ctxt, IXML_Document *desc_doc, st
>>  				deviceNode = (upnp_igd_device_node *)  malloc(sizeof(upnp_igd_device_node));
>>  				memset(deviceNode->device.services, '\0', sizeof(upnp_igd_service) * IGD_SERVICE_SERVCOUNT);
>>  				strncpy(deviceNode->device.udn, UDN, sizeof(deviceNode->device.udn));
>> -				strncpy(deviceNode->device.desc_doc_url, d_event->Location, sizeof(deviceNode->device.desc_doc_url));
>> +				strncpy(deviceNode->device.desc_doc_url, UpnpString_get_String(UpnpDiscovery_get_Location(d_event)), sizeof(deviceNode->device.desc_doc_url));

ditto and a few more times also for UpnpActionComplete_get_CtrlUrl and
UpnpDiscovery_get_DeviceID.

>>  				strncpy(deviceNode->device.friendly_name, friendlyName, sizeof(deviceNode->device.friendly_name));
>>  				strncpy(deviceNode->device.model_name, modelName, sizeof(deviceNode->device.model_name));
>>  				strncpy(deviceNode->device.model_number, modelNumber, sizeof(deviceNode->device.model_number));
>>  				strncpy(deviceNode->device.pres_url, presURL, sizeof(deviceNode->device.pres_url));
>> -				deviceNode->device.advr_time_out = d_event->Expires;
>> +				deviceNode->device.advr_time_out = UpnpDiscovery_get_Expires(d_event);
>>  
>>  				// Reset values
>>  				serviceId = NULL;
>> @@ -468,7 +468,7 @@ void upnp_igd_add_device(upnp_igd_context *igd_ctxt, IXML_Document *desc_doc, st
>>  
>>  				for (service = 0; service < IGD_SERVICE_SERVCOUNT;
>>  				     service++) {
>> -					if (upnp_igd_get_find_and_parse_service(igd_ctxt, desc_doc, d_event->Location,
>> +					if (upnp_igd_get_find_and_parse_service(igd_ctxt, desc_doc, UpnpString_get_String(UpnpDiscovery_get_Location(d_event)),
>>  							IGDServiceType[service], &serviceId, &event_url, &controlURL)) {
>>  						upnp_igd_print(igd_ctxt, UPNP_IGD_DEBUG, "Subscribing to EventURL %s...",event_url);
>>  						ret =
>> @@ -891,16 +891,16 @@ int upnp_igd_callback(Upnp_EventType event_type, void* event, void *cookie) {
>>  	switch(event_type) {
>>      	case UPNP_DISCOVERY_ADVERTISEMENT_ALIVE:
>>      	case UPNP_DISCOVERY_SEARCH_RESULT: {
>> -    		struct Upnp_Discovery *d_event = (struct Upnp_Discovery *)event;
>> +    		UpnpDiscovery *d_event = (UpnpDiscovery *)event;
>>      		IXML_Document *desc_doc = NULL;
>>      		int ret;
>>  
>> -    		if (d_event->ErrCode != UPNP_E_SUCCESS) {
>> -    			upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in Discovery Callback -- %d", d_event->ErrCode);
>> +    		if (UpnpDiscovery_get_ErrCode(d_event) != UPNP_E_SUCCESS) {
>> +    			upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in Discovery Callback -- %d", UpnpDiscovery_get_ErrCode(d_event));
>>      		}
>> -    		ret = UpnpDownloadXmlDoc(d_event->Location, &desc_doc);
>> +    		ret = UpnpDownloadXmlDoc(UpnpString_get_String(UpnpDiscovery_get_Location(d_event)), &desc_doc);
>>      		if (ret != UPNP_E_SUCCESS) {
>> -    			upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error obtaining device description from %s -- error = %d", d_event->Location, ret);
>> +    			upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error obtaining device description from %s -- error = %d", UpnpString_get_String(UpnpDiscovery_get_Location(d_event)), ret);
>>      		} else {
>>      			upnp_igd_add_device(igd_ctxt, desc_doc, d_event);
>>      		}
>> @@ -910,64 +910,64 @@ int upnp_igd_callback(Upnp_EventType event_type, void* event, void *cookie) {
>>      	}
>>      	break;
>>      	case UPNP_DISCOVERY_ADVERTISEMENT_BYEBYE: {
>> -    		struct Upnp_Discovery *d_event = (struct Upnp_Discovery *)event;
>> -    		if (d_event->ErrCode != UPNP_E_SUCCESS) {
>> -    			upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in Discovery ByeBye Callback -- %d", d_event->ErrCode);
>> +    		UpnpDiscovery *d_event = (UpnpDiscovery *)event;
>> +    		if (UpnpDiscovery_get_ErrCode(d_event) != UPNP_E_SUCCESS) {
>> +    			upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in Discovery ByeBye Callback -- %d", UpnpDiscovery_get_ErrCode(d_event));
>>      		}
>> -    		upnp_igd_remove_device(igd_ctxt, d_event->DeviceId);
>> +    		upnp_igd_remove_device(igd_ctxt, UpnpString_get_String((d_event)));

This looks wrong. UpnpEvent_get_DeviceId_cstr?

>>      	}
>>      	break;
>>      	/* SOAP Stuff */
>>      	case UPNP_CONTROL_ACTION_COMPLETE: {
>> -    		struct Upnp_Action_Complete *a_event = (struct Upnp_Action_Complete *)event;
>> +    		UpnpActionComplete *a_event = (UpnpActionComplete *)event;
>>  
>> -    		if (a_event->ErrCode != UPNP_E_SUCCESS) {
>> -    			upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in  Action Complete Callback -- %d", a_event->ErrCode);
>> +    		if (UpnpActionComplete_get_ErrCode(a_event) != UPNP_E_SUCCESS) {
>> +    			upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in  Action Complete Callback -- %d", UpnpActionComplete_get_ErrCode(a_event));
>>      		} else {
>> -    			upnp_igd_handle_send_action(igd_ctxt, UPNP_STRING(a_event->CtrlUrl), a_event->ActionRequest, 

I guess UPNP_STRING is here to handle Debian's CtrlUrl being different
than upstream. When this is converted to
UpnpActionComplete_get_CtrlUrl_cstr it should be possible to drop it.

a_event->ActionResult);
>> +    			upnp_igd_handle_send_action(igd_ctxt, UPNP_STRING(UpnpActionComplete_get_CtrlUrl(a_event)), UpnpActionComplete_get_ActionRequest(a_event), UpnpActionComplete_get_ActionResult(a_event));

Best regards
Uwe

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-voip-maintainers/attachments/20180205/7b3d71c3/attachment.sig>


More information about the Pkg-voip-maintainers mailing list