~ubuntu-branches/ubuntu/vivid/mediatomb/vivid

« back to all changes in this revision

Viewing changes to src/server.cc

  • Committer: Bazaar Package Importer
  • Author(s): Andres Mejia
  • Date: 2008-03-02 13:09:16 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080302130916-zlljdze3kt7vuq4b
Tags: 0.11.0-1
* New upstream release.
* Include message about which inotify headers will be used when enabling
  inotify runtime support.
* Fixed error with use of INTERFACE in init script. Also removed use of -m
  option.
* Including new config.xml options.
* Added more build dependencies for new upstream release.
* Removed build dependency of libid3-dev, taglib is now preferred.
* mediatomb.xpm and manpage.xml is now included in orig tarball.
* inotify patch is not needed anymore.
* md5 patch has been committed upstream and is no longer needed. Also removed
  README.Debian.
* TwinHelix PNG fix is now used. Removed from TODO.
* Adding dependency of iceweasel for mediatomb package.
* Updated copyright file.
* Updated watch file.
* Updated rules file for proper configure options.

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
    Copyright (C) 2005 Gena Batyan <bgeradz@mediatomb.cc>,
8
8
                       Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>
9
9
    
10
 
    Copyright (C) 2006-2007 Gena Batyan <bgeradz@mediatomb.cc>,
 
10
    Copyright (C) 2006-2008 Gena Batyan <bgeradz@mediatomb.cc>,
11
11
                            Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>,
12
12
                            Leonhard Wimmer <leo@mediatomb.cc>
13
13
    
24
24
    version 2 along with MediaTomb; if not, write to the Free Software
25
25
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
26
26
    
27
 
    $Id: server.cc 1356 2007-06-12 22:59:19Z jin_eld $
 
27
    $Id: server.cc 1698 2008-02-23 20:48:30Z lww $
28
28
*/
29
29
 
30
30
/// \file server.cc
33
33
    #include "autoconfig.h"
34
34
#endif
35
35
 
 
36
#ifdef HAVE_CURL
 
37
    #include <curl/curl.h>
 
38
#endif
 
39
 
36
40
#include "server.h"
37
41
#include "web_callbacks.h"
38
42
#include "content_manager.h"
92
96
    
93
97
    serverUDN = config->getOption(CFG_SERVER_UDN);
94
98
    alive_advertisement = config->getIntOption(CFG_SERVER_ALIVE_INTERVAL);
 
99
 
 
100
#ifdef HAVE_CURL
 
101
    curl_global_init(CURL_GLOBAL_ALL);
 
102
#endif
95
103
}
96
104
 
97
105
void Server::upnp_init(String iface, String ip_address, int port)
120
128
 
121
129
    if (string_ok(iface) && !string_ok(ip))
122
130
        throw _Exception(_("Could not find interface: ") + iface);
 
131
/*
 
132
    // without this lod_debug coredumped on Solaris...
 
133
    if (iface == nil)
 
134
        iface = _("");
123
135
 
 
136
    if (ip == nil)
 
137
        ip = _("");
 
138
    
124
139
    log_debug("interface: %s ip: %s\n", iface.c_str(), ip.c_str());
125
140
 
126
 
 
 
141
    if (ip == "")
 
142
        ip = nil;
 
143
*/
127
144
    if (port < 0)
128
145
    {
129
146
        port = config->getIntOption(CFG_SERVER_PORT);
233
250
    String device_description = 
234
251
        _("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n") +
235
252
         UpnpXML_RenderDeviceDescription(presentationURL)->print();
236
 
 
237
 
//    log_debug("DEVICE DESCRIPTION: \n%s\n", device_description.c_str());
 
253
         
 
254
    //log_debug("DEVICE DESCRIPTION: \n%s\n", device_description.c_str());
238
255
 
239
256
    // register root device with the library
240
257
    ret = UpnpRegisterRootDevice2(UPNPREG_BUF_DESC, device_description.c_str(), 
312
329
    {   
313
330
        throw _UpnpException(ret, _("upnp_cleanup: UpnpUnRegisterRootDevice failed"));
314
331
    }
315
 
    
 
332
 
 
333
#ifdef HAVE_CURL
 
334
    curl_global_cleanup();
 
335
#endif
 
336
 
316
337
    log_debug("now calling upnp finish\n");
317
338
    UpnpFinish();
318
339
    storage = nil;