Skip to content

Commit

Permalink
Merge branch 'master' into 650/truncated_filestore_messages
Browse files Browse the repository at this point in the history
  • Loading branch information
the-thing authored Jul 27, 2023
2 parents 66c566d + e612ee6 commit 54690e5
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ <H3>QuickFIX Settings</H3>
<TD> Valid XML data dictionary file, QuickFIX/J comes with the following defaults in the <code>etc</code> directory:
FIXT11.xml, FIX50.xml, FIX44.xml, FIX43.xml, FIX42.xml, FIX41.xml, FIX40.xml.
</TD>
<TD>If DataDictionary is not specified and UserDataDictionary=Y, then QuickFIX/J will look for a
<TD>If DataDictionary is not specified and UseDataDictionary=Y, then QuickFIX/J will look for a
default dictionary based on the session's BeginString (e.g., FIX.4.2 = FIX42.xml). The DataDictionary
file search strategy is to use a URL, then the file system, and then the thread context classloader (if any),
and then the DataDictionary instance's classloader. Default data dictionary files
Expand Down Expand Up @@ -1267,7 +1267,7 @@ <H3>QuickFIX Settings</H3>
<TR ALIGN="left" VALIGN="middle">
<TD> <I>ResendRequestChunkSize</I> </TD>
<TD> Setting to limit the size of a resend request in case of missing messages.
This is useful when the remote FIX engine does not allow to ask for more than n message for a ResendRequest.
This is useful when the remote FIX engine does not allow to ask for more than n message for a ResendRequest. It also allows you to prevent a 'self-DDOS' by accidentally requesting a huge flood of messages your system isn't capable of processing if you are substantially behind for some reason.
<P>
E.g. if the ResendRequestChunkSize is set to 5 and a gap of 7 messages is detected,
a first resend request will be sent for 5 messages.
Expand Down
16 changes: 15 additions & 1 deletion quickfixj-core/src/main/java/quickfix/FileUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;


public class FileUtil {
public static String fileAppendPath(String pathPrefix, String pathSuffix) {
Expand Down Expand Up @@ -141,7 +144,18 @@ public static InputStream open(Class<?> clazz, String name, Location... location
break;
case URL:
try {
in = new URL(name).openStream();
URL url = new URL(name);
URLConnection urlConnection = url.openConnection();
if (urlConnection instanceof HttpURLConnection) {
HttpURLConnection httpURLConnection = (HttpURLConnection)urlConnection;
httpURLConnection.setRequestProperty("User-Agent", "Java-QuickFIXJ-FileUtil");
httpURLConnection.connect();
in = httpURLConnection.getInputStream();
} else {
if (urlConnection != null) {
in = urlConnection.getInputStream();
}
}
} catch (IOException e) {
// ignore
}
Expand Down
9 changes: 9 additions & 0 deletions quickfixj-core/src/test/java/quickfix/FileUtilTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@ public void testURLLocation() throws Exception {
}
}

@Test
public void testJARURLLocation() throws Exception {
// just test that we don't run into a ClassCastException
InputStream in = FileUtil.open(Message.class, "jar:file:/foo.bar!/");
if (in != null) {
in.close();
}
}

@Test
// QFJ-775
public void testSessionIDFileName() {
Expand Down

0 comments on commit 54690e5

Please sign in to comment.