http files: Fix for servers w/o file size limit
This commit is contained in:
parent
0206139f0f
commit
e3e6a426f4
|
@ -15,7 +15,6 @@ public class UploadStreamModule : XmppStreamModule {
|
||||||
public delegate void OnUploadOk(XmppStream stream, string url_down);
|
public delegate void OnUploadOk(XmppStream stream, string url_down);
|
||||||
public delegate void OnError(XmppStream stream, string error);
|
public delegate void OnError(XmppStream stream, string error);
|
||||||
public void upload(XmppStream stream, string file_uri, owned OnUploadOk listener, owned OnError error_listener) {
|
public void upload(XmppStream stream, string file_uri, owned OnUploadOk listener, owned OnError error_listener) {
|
||||||
print("up!\n");
|
|
||||||
File file = File.new_for_path(file_uri);
|
File file = File.new_for_path(file_uri);
|
||||||
FileInfo file_info = file.query_info("*", FileQueryInfoFlags.NONE);
|
FileInfo file_info = file.query_info("*", FileQueryInfoFlags.NONE);
|
||||||
request_slot(stream, file.get_basename(), (int)file_info.get_size(), file_info.get_content_type(),
|
request_slot(stream, file.get_basename(), (int)file_info.get_size(), file_info.get_content_type(),
|
||||||
|
@ -146,7 +145,8 @@ public class UploadStreamModule : XmppStreamModule {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return max_file_size_str != null ? int.parse(max_file_size_str) : (int?) null;
|
if (max_file_size_str != null) return int.parse(max_file_size_str);
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue