Revision a2da678c

View differences:

chunker_player/http.c
1 1
// based on curl/examples/{simple,getinmemory,ftpget}.c
2 2

  
3
#include <string.h>
4
#include <stdlib.h>
3 5
#include <stdio.h>
4 6
#include <curl/curl.h>
5 7

  
......
30 32
  return fwrite(buffer, size, nmemb, out->stream);
31 33
}
32 34

  
33
int http_get2file(char *uri, char*fname)
35
int http_get2file(char *uri, char *fname)
34 36
{
35 37
  CURL *curl;
36 38
  CURLcode res;
......
39 41
    NULL
40 42
  };
41 43

  
44
  if (strncmp(fname, "~/", 2) == 0) {	/* curl can't handle ~ in the filename */
45
    char *fname2;
46
    char *home = getenv("HOME");
47
    if (!home) return -1;
48

  
49
    fname2 = malloc(strlen(home) + strlen(fname));
50
    if (!fname2) return -1;
51

  
52
    strcpy(fname2, home);
53
    strcpy(fname2 + strlen(home), fname+1);
54
    ftpfile.filename = fname2;
55
  }
56

  
42 57
  curl_global_init(CURL_GLOBAL_DEFAULT);
43 58

  
44 59
  curl = curl_easy_init();
chunker_player/player_defines.h
29 29
#define CHANNEL_UP_ICON_FILE "icons/up_16.png"
30 30
#define CHANNEL_DOWN_ICON_FILE "icons/down_16.png"
31 31

  
32
#define DEFAULT_CONF_FILENAME "channels.conf"
32
#define DEFAULT_CONF_FILEDIR "~/.peerstreamer/"
33
#define DEFAULT_CONF_FILENAME DEFAULT_CONF_FILEDIR"channels.conf"
33 34
#define DEFAULT_CONF_URI "http://peerstreamer.org/~napawine/release/channels.conf"
34 35
#define DEFAULT_PEEREXECNAME_FILENAME "peer_exec_name.conf"
35 36
#define DEFAULT_PEER_EXEC_NAME "streamer"

Also available in: Unified diff