Mostly whitespaces and code convergence.
client_table has been totaly rewritten, so remove the old license. git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@536 119443c7-1b9e-41f8-b6fc-b9c35fce742c
This commit is contained in:
parent
01039a1d9a
commit
7f1be91e76
@ -1798,7 +1798,7 @@ exit_function:
|
|||||||
|
|
||||||
|
|
||||||
#ifdef INCLUDE_CLIENT_APIS
|
#ifdef INCLUDE_CLIENT_APIS
|
||||||
int UpnpUnSubscribe(UpnpClient_Handle Hnd,const Upnp_SID SubsId)
|
int UpnpUnSubscribe(UpnpClient_Handle Hnd, const Upnp_SID SubsId)
|
||||||
{
|
{
|
||||||
struct Handle_Info *SInfo = NULL;
|
struct Handle_Info *SInfo = NULL;
|
||||||
int retVal;
|
int retVal;
|
||||||
@ -3208,15 +3208,14 @@ void UpnpThreadDistribution(struct UpnpNonblockParam *Param)
|
|||||||
#if EXCLUDE_GENA == 0
|
#if EXCLUDE_GENA == 0
|
||||||
case SUBSCRIBE: {
|
case SUBSCRIBE: {
|
||||||
UpnpEventSubscribe *evt = UpnpEventSubscribe_new();
|
UpnpEventSubscribe *evt = UpnpEventSubscribe_new();
|
||||||
// cast away constness
|
const UpnpString *Sid = UpnpEventSubscribe_get_SID(evt);
|
||||||
UpnpString *sid = (UpnpString *)UpnpEventSubscribe_get_SID(evt);
|
|
||||||
|
|
||||||
UpnpEventSubscribe_strcpy_PublisherUrl(evt, Param->Url);
|
UpnpEventSubscribe_strcpy_PublisherUrl(evt, Param->Url);
|
||||||
errCode = genaSubscribe(
|
errCode = genaSubscribe(
|
||||||
Param->Handle,
|
Param->Handle,
|
||||||
UpnpEventSubscribe_get_PublisherUrl(evt),
|
UpnpEventSubscribe_get_PublisherUrl(evt),
|
||||||
(int *)&Param->TimeOut,
|
(int *)&Param->TimeOut,
|
||||||
sid);
|
Sid);
|
||||||
UpnpEventSubscribe_set_ErrCode(evt, errCode);
|
UpnpEventSubscribe_set_ErrCode(evt, errCode);
|
||||||
UpnpEventSubscribe_set_TimeOut(evt, Param->TimeOut);
|
UpnpEventSubscribe_set_TimeOut(evt, Param->TimeOut);
|
||||||
Param->Fun(UPNP_EVENT_SUBSCRIBE_COMPLETE, evt, Param->Cookie);
|
Param->Fun(UPNP_EVENT_SUBSCRIBE_COMPLETE, evt, Param->Cookie);
|
||||||
|
@ -101,8 +101,7 @@ static void GenaAutoRenewSubscription(
|
|||||||
if( GetHandleInfo( event->handle, &handle_info ) != HND_CLIENT ) {
|
if( GetHandleInfo( event->handle, &handle_info ) != HND_CLIENT ) {
|
||||||
HandleUnlock();
|
HandleUnlock();
|
||||||
free_upnp_timeout(event);
|
free_upnp_timeout(event);
|
||||||
|
goto end_function;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
UpnpPrintf(UPNP_INFO, GENA, __FILE__, __LINE__, "HANDLE IS VALID");
|
UpnpPrintf(UPNP_INFO, GENA, __FILE__, __LINE__, "HANDLE IS VALID");
|
||||||
|
|
||||||
@ -114,6 +113,9 @@ static void GenaAutoRenewSubscription(
|
|||||||
}
|
}
|
||||||
|
|
||||||
free_upnp_timeout(event);
|
free_upnp_timeout(event);
|
||||||
|
|
||||||
|
end_function:
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -136,19 +138,22 @@ static int ScheduleGenaAutoRenew(
|
|||||||
int return_code = GENA_SUCCESS;
|
int return_code = GENA_SUCCESS;
|
||||||
ThreadPoolJob job;
|
ThreadPoolJob job;
|
||||||
|
|
||||||
if( TimeOut == UPNP_INFINITE ) {
|
if (TimeOut == UPNP_INFINITE) {
|
||||||
return GENA_SUCCESS;
|
return_code = GENA_SUCCESS;
|
||||||
|
goto end_function;
|
||||||
}
|
}
|
||||||
|
|
||||||
RenewEventStruct = UpnpEventSubscribe_new();
|
RenewEventStruct = UpnpEventSubscribe_new();
|
||||||
if( RenewEventStruct == NULL ) {
|
if (RenewEventStruct == NULL) {
|
||||||
return UPNP_E_OUTOF_MEMORY;
|
return_code = UPNP_E_OUTOF_MEMORY;
|
||||||
|
goto end_function;
|
||||||
}
|
}
|
||||||
|
|
||||||
RenewEvent = (upnp_timeout *) malloc(sizeof(upnp_timeout));
|
RenewEvent = (upnp_timeout *) malloc(sizeof(upnp_timeout));
|
||||||
if( RenewEvent == NULL ) {
|
if (RenewEvent == NULL) {
|
||||||
free( RenewEventStruct );
|
free(RenewEventStruct);
|
||||||
return UPNP_E_OUTOF_MEMORY;
|
return_code = UPNP_E_OUTOF_MEMORY;
|
||||||
|
goto end_function;
|
||||||
}
|
}
|
||||||
|
|
||||||
// schedule expire event
|
// schedule expire event
|
||||||
@ -175,13 +180,16 @@ static int ScheduleGenaAutoRenew(
|
|||||||
if (return_code != UPNP_E_SUCCESS) {
|
if (return_code != UPNP_E_SUCCESS) {
|
||||||
free(RenewEvent);
|
free(RenewEvent);
|
||||||
free(RenewEventStruct);
|
free(RenewEventStruct);
|
||||||
|
goto end_function;
|
||||||
return return_code;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
UpnpClientSubscription_set_RenewEventId(sub, RenewEvent->eventId);
|
UpnpClientSubscription_set_RenewEventId(sub, RenewEvent->eventId);
|
||||||
|
|
||||||
return GENA_SUCCESS;
|
return_code = GENA_SUCCESS;
|
||||||
|
|
||||||
|
end_function:
|
||||||
|
|
||||||
|
return return_code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,34 +1,3 @@
|
|||||||
/**************************************************************************
|
|
||||||
*
|
|
||||||
* Copyright (c) 2000-2003 Intel Corporation
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* - Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* - Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
* - Neither name of Intel Corporation nor the names of its contributors
|
|
||||||
* may be used to endorse or promote products derived from this software
|
|
||||||
* without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
||||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
|
||||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
||||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef CLIENT_TABLE_H
|
#ifndef CLIENT_TABLE_H
|
||||||
#define CLIENT_TABLE_H
|
#define CLIENT_TABLE_H
|
||||||
|
Loading…
x
Reference in New Issue
Block a user