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:
Marcelo Roberto Jimenez 2010-04-25 00:29:52 +00:00
parent 01039a1d9a
commit 7f1be91e76
3 changed files with 23 additions and 47 deletions

View File

@ -1798,7 +1798,7 @@ exit_function:
#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;
int retVal;
@ -3208,15 +3208,14 @@ void UpnpThreadDistribution(struct UpnpNonblockParam *Param)
#if EXCLUDE_GENA == 0
case SUBSCRIBE: {
UpnpEventSubscribe *evt = UpnpEventSubscribe_new();
// cast away constness
UpnpString *sid = (UpnpString *)UpnpEventSubscribe_get_SID(evt);
const UpnpString *Sid = UpnpEventSubscribe_get_SID(evt);
UpnpEventSubscribe_strcpy_PublisherUrl(evt, Param->Url);
errCode = genaSubscribe(
Param->Handle,
UpnpEventSubscribe_get_PublisherUrl(evt),
(int *)&Param->TimeOut,
sid);
Sid);
UpnpEventSubscribe_set_ErrCode(evt, errCode);
UpnpEventSubscribe_set_TimeOut(evt, Param->TimeOut);
Param->Fun(UPNP_EVENT_SUBSCRIBE_COMPLETE, evt, Param->Cookie);

View File

@ -101,8 +101,7 @@ static void GenaAutoRenewSubscription(
if( GetHandleInfo( event->handle, &handle_info ) != HND_CLIENT ) {
HandleUnlock();
free_upnp_timeout(event);
return;
goto end_function;
}
UpnpPrintf(UPNP_INFO, GENA, __FILE__, __LINE__, "HANDLE IS VALID");
@ -114,6 +113,9 @@ static void GenaAutoRenewSubscription(
}
free_upnp_timeout(event);
end_function:
return;
}
@ -136,19 +138,22 @@ static int ScheduleGenaAutoRenew(
int return_code = GENA_SUCCESS;
ThreadPoolJob job;
if( TimeOut == UPNP_INFINITE ) {
return GENA_SUCCESS;
if (TimeOut == UPNP_INFINITE) {
return_code = GENA_SUCCESS;
goto end_function;
}
RenewEventStruct = UpnpEventSubscribe_new();
if( RenewEventStruct == NULL ) {
return UPNP_E_OUTOF_MEMORY;
if (RenewEventStruct == NULL) {
return_code = UPNP_E_OUTOF_MEMORY;
goto end_function;
}
RenewEvent = (upnp_timeout *) malloc(sizeof(upnp_timeout));
if( RenewEvent == NULL ) {
free( RenewEventStruct );
return UPNP_E_OUTOF_MEMORY;
if (RenewEvent == NULL) {
free(RenewEventStruct);
return_code = UPNP_E_OUTOF_MEMORY;
goto end_function;
}
// schedule expire event
@ -175,13 +180,16 @@ static int ScheduleGenaAutoRenew(
if (return_code != UPNP_E_SUCCESS) {
free(RenewEvent);
free(RenewEventStruct);
return return_code;
goto end_function;
}
UpnpClientSubscription_set_RenewEventId(sub, RenewEvent->eventId);
return GENA_SUCCESS;
return_code = GENA_SUCCESS;
end_function:
return return_code;
}

View File

@ -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
#define CLIENT_TABLE_H